import java.util.Scanner;

public class C1_12_8 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] key = sc.nextLine().toCharArray();
        char[] secret = sc.nextLine().toCharArray();
        int index = 0;
        for (int i = 0; i < secret.length; i++) {
            if (index == key.length)
                index = 0;
            int t = 0;
            if ('a' <= key[index] && key[index] <= 'z') {
                t = key[index++] - 'a';
            } else {
                t = key[index++] - 'A';
            }
            if ('a' <= secret[i] && secret[i] <= 'z') {
                if (secret[i] - t < 'a') {
                    System.out.print((char) ('z' - t + secret[i] - 'a' +1));
                }else{
                    System.out.print((char)(secret[i] - t));
                }
            } else {
                if (secret[i] - t < 'A') {
                    System.out.print((char) ('Z' - t + secret[i] - 'A' +1));
                }else{
                    System.out.print((char)(secret[i] - t));
                }
            }

        }
    }
}